﻿@page
@model KentNoteBook.WebApp.Pages.UserManagement.PermissionModel
@{
	ViewData["Title"] = "Permission";
	Layout = null;
}

<!--- Breadcrumbs -->
<ol class="breadcrumb">
	<li class="breadcrumb-item">
		<a href="#" ajax-link="true" data-url="/dashboard" data-update-panel=".main-container">Dashboard</a>
	</li>
	<li class="breadcrumb-item">
		<a href="#" ajax-link="true" data-url="/UserManagement/Users" data-update-panel=".main-container">User Management</a>
	</li>
	<li class="breadcrumb-item active">Permissions</li>
</ol>

<form data-ajax-request="true" method="post">
	<div id="alert_panel"></div>

	<ul class="nav nav-tabs" id="permissionTab" role="tablist">
		<li class="nav-item">
			<a class="nav-link active" id="menuPermissionTab" data-toggle="tab" href="#menuPermissionPanel" role="tab" aria-controls="menuPermissionPanel" aria-selected="true">Menu Permissions</a>
		</li>
		<li class="nav-item">
			<a class="nav-link" id="dataPermissionTab" data-toggle="tab" href="#dataPermissionPanel" role="tab" aria-controls="dataPermissionPanel" aria-selected="false">Data Permissions</a>
		</li>
	</ul>
	<div class="tab-content mt-4" id="tabContent">
		<div class="tab-pane fade show active" id="menuPermissionPanel" role="tabpanel" aria-labelledby="menuPermissionTab"></div>
		<div class="tab-pane fade" id="dataPermissionPanel" role="tabpanel" aria-labelledby="dataPermissionTab"></div>
	</div>
</form>

<script type="text/javascript">
	$.renderPartial($("#menuPermissionPanel"), "UserManagement/MenuPermissions");

	$('#permissionTab a[data-toggle="tab"]').on('show.bs.tab', function (e) {
		if ($(e.target).attr("id") == "dataPermissionTab") {
			setTimeout(function () {
				$.renderPartial($("#dataPermissionPanel"), "UserManagement/DataPermissions");
			}, 200);
		}
	})
</script>


